<template>
	<view>
		<view class="tabbar">
			<view class="list">
				<view class="right" v-if="refuse">
					<button :class="plain ? 'refplain' : 'refcolor'" type="primary" size="mini"
						@tap.stop.native="handleClick()">
						<text class="text-md-Medium">{{text}}</text>
					</button>
				</view>
				<view class="right" v-else>
					<button :class="plain ? 'plaincolor' : 'btncolor'" type="primary" size="mini"
						@tap.stop.native="handleClick()">
						<text class="text-md-Medium">{{text}}</text>
					</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "tabbar-button-group",
		props: {
			onClick: {
				type: Function
			},
			text: {
				type: String
			},
			plain: {
				type: Boolean,
				default: false
			},
			refuse:{
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			};
		},
		methods: {
			handleClick() {
				// this.onClick();
				this.$emit('click');
			}
		},
	}
</script>

<style lang="scss" scoped>
	.tabbar {
		width: 100%;
		position: fixed;
		bottom: 0;
		padding-bottom: 42rpx;
		left: 0;
		border-top: 1rpx solid $gray-200;
		background-color: $white;
		z-index: 100;

		.list {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 24rpx 32rpx;

			.right {
				width: 100%;

				.btncolor {
					width: 100%;
					background-color: $brand-500;
					color: $white;
					padding: 16rpx 32rpx;
					border-radius: 40rpx;
					text-align: center;
					line-height: 46rpx;
					vertical-align: middle;
				}
				
				.refcolor {
					width: 100%;
					background-color: $error-500;
					color: $white;
					padding: 16rpx 32rpx;
					border-radius: 40rpx;
					text-align: center;
					line-height: 46rpx;
					vertical-align: middle;
				}

				.plaincolor {
					width: 100%;
					border: 1rpx solid $brand-500;
					background-color: $white;
					color: $brand-500;
					padding: 16rpx 32rpx;
					border-radius: 40rpx;
					text-align: center;
					line-height: 46rpx;
					vertical-align: middle;
				}
				
				.refplain {
					width: 100%;
					border: 1rpx solid $error-500;
					background-color: $white;
					color: $error-500;
					padding: 16rpx 32rpx;
					border-radius: 40rpx;
					text-align: center;
					line-height: 46rpx;
					vertical-align: middle;
				}
			}
		}
	}
</style>